<!DOCTYPE html>
<html>
<head>
    <title>我的海报</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="__FRONT__/dist/lib/weui.min.css">
    <link rel="stylesheet" type="text/css" href="__FRONT__/dist/css/jquery-weui.min.css">
    <link rel="stylesheet" type="text/css" href="__FRONT__/dist/demos/css/demos.css">
    <script src="__FRONT__/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="__FRONT__/js/jquery.qrcode.min.js"></script>
    <style type="text/css">
        body{
            margin: 0px;
            padding: 0px;
        }
    </style>
</head>
<body>
    <img src="__FRONT__/img/bg.jpg" style="width: 100%; height: 100%;background-size:100% 100%;">
   <!-- <div id="expiry" align="center">
        <p>过期时间:2018-06-28 09:09:28 </p>
    </div>-->
    <div class="weui-tabbar" style="position:absolute;border-top:1px solid #ccc;">
        <a href="{:url('index')}" class="weui-tabbar__item">
            <div class="weui-tabbar__icon">
                <img src="__FRONT__/img/home2.png" alt="">
            </div>
            <p class="weui-tabbar__label">参与挑战</p>
        </a>
        <a href="{:url('Index/center')}" class="weui-tabbar__item">
            <div class="weui-tabbar__icon">
                <img src="__FRONT__/img/ren.png" alt="">
            </div>
            <p class="weui-tabbar__label">个人中心</p>
        </a>
        <a href="{:url('Index/read')}" class="weui-tabbar__item">
            <div class="weui-tabbar__icon">
                <img src="__FRONT__/img/eye.png" alt="">
            </div>
            <p class="weui-tabbar__label">参与必读</p>
        </a>
    </div>
    <div id="code" style="padding: 6px 6px 11px 6px;background-color:#fff;width:150px;height:140px;position: absolute;z-index: 9999;bottom:140px;margin:0 auto;left:0;right:0"></div>
    <script>
        $(function(){
            var str =toUtf8("{:url('/index/user/reg',['pid'=>cookie('uid')],'',true)}");
            console.log(str);
            $("#code").qrcode({
                render: "table",
                width:150,
                height:140,
                text: str
            });
        });



        function toUtf8(str) {
            var out, i, len, c;
            out = "";
            len = str.length;
            for(i = 0; i < len; i++) {
                c = str.charCodeAt(i);
                if ((c >= 0x0001) && (c <= 0x007F)) {
                    out += str.charAt(i);
                } else if (c > 0x07FF) {
                    out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
                    out += String.fromCharCode(0x80 | ((c >>  6) & 0x3F));
                    out += String.fromCharCode(0x80 | ((c >>  0) & 0x3F));
                } else {
                    out += String.fromCharCode(0xC0 | ((c >>  6) & 0x1F));
                    out += String.fromCharCode(0x80 | ((c >>  0) & 0x3F));
                }
            }
            return out;
        }
    </script>
</body>
</html>